package cn.mazexal.exambg.models.enums;

import lombok.Getter;

@Getter
public enum ExamTypeEnum {

    // 1真实试卷，2模拟考，3智能组卷,4随机套题,5组织考试

    REAL_EXAM(1, "真题"),

    PRACTISE_EXAM(2, "专项练习"),

    AUTO_EXAM(3, "智能组卷"),
    RANDOM_EXAM(4, "随机套题"),
    ORGANIZATION_EXAM(5, "组织考试"),
    EXAM_BANK(6, "题库"),;

    private Integer code;
    private String desc;

    ExamTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ExamTypeEnum getByCode(Integer code) {
        for (ExamTypeEnum item : ExamTypeEnum.values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }

}
